<script>

    /**
     *  循环数组示例
     */
    function foreach() {
        var direct_team_list = [];
        $.each(direct_team_list, function (key, customer_info) {
        });
    }

    /**
     * layer弹层提示
     */
    function layer() {
        layer.confirm('确认作废该出库单吗？', function(index) {

        });
    }
    /**
     * ajax请求示例
     * @param e
     */
    function check(e) {
        var customer_id = $(e).attr('customer_id');
        var index = layer.load(2, {
            shade: [0.5, '#fff'] //0.1透明度的白色背景
        });
        $.ajax({
            type: 'post',
            url: '/customer/check',
            data: {customer_id: customer_id},
            dateType: 'json',
            success: function (response) {
                if (response.code === 200) {
                    layer.alert(response.message);
                    window.location.reload();
                } else {
                    layer.alert(response.message);
                }
                layer.close(index);
            }
        });
    }
</script>